import java.util.Scanner;

public class Worl10 {
    public static void main(String[] args) {
        System.out.println("输入任意一个正整数");
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int i;
        int b = 0;
        int sum = 0;
        for (i = 10; a / i > 0;i++ ) {  
            b = a % 10;
            a = a / 10;
            sum=sum+b;
        }
        sum = sum + a;
        System.out.println(sum);
    }
}
